const path = require('path')

module.exports = {
    chainWebpack: config => {
        config.resolve.alias
            .set('@', path.resolve(__dirname, './src/components'))
            .set('assets', path.resolve(__dirname, './src/assets'))
            .set('views', path.resolve(__dirname, './src/views'))
    },
    devServer: {
        proxy: {
            '/swipe':{
                target: "https://h5.biyao.com/api/home/getHomeGroupInfo",
                changeOrigin:true,
                pathRewrite: {
                    '/swipe': ''
                }
            },
            'navlist': {
                target: "http://localhost:9000",
                changeOrigin: true
            },
            '/navList1': {
                target: 'https://h5.biyao.com/classify/getSubScrubeQyery',
                changeOrigin: true,
                pathRewrite: {
                    '/navList1': ''
                }
            },
            'group':{
                target:'https://m.biyao.com/togetherGroup/getTogetherProductList',
                changeOrigin:'true',
                pathRewrite: {
                    '/group': ''
                }
            },
            '/class/navList': {
                target: 'http://localhost:9000',
                changeOrigin: true,
                // pathRewrite:{
                //     '/class/navList':''
                // }

            },
            '/classify/navList': {
                target: 'https://h5.biyao.com/classify/getSubScrubeQyery',
                changeOrigin: true,
                pathRewrite: {
                    '/classify/navList': ''
                }
            },
            '/search': {
                target: "https://m.biyao.com/search/queryAstlWords",
                changeOrigin: true,
                pathRewrite: {
                    '/search': ''
                }
            },
            '/searchShop': {
                target: "https://m.biyao.com/search/goSearch",
                changeOrigin: true,
                pathRewrite: {
                    '^/searchShop': ''
                }
            },
            '/llll': {
                target : "https://m.biyao.com/search/goSearch",
                changeOrigin: true,
                pathRewrite:{
                    '/llll':''
                }
            },
            '/biyao': {
                target: 'https://h5.biyao.com/classify/getCategoryProductList',
                changeOrigin: true,
                pathRewrite: {
                    '/biyao': ''
                }
            },
            '/getFilterAttr': {
                target: 'https://h5.biyao.com/api/classify/getFilterAttrs',
                changeOrigin: true,
                pathRewrite:{
                    '/getFilterAttr':''
                }
            },
            '/shopList': {
                target: 'https://h5.biyao.com/api/home/floorlist',
                changeOrigin: true,
                pathRewrite: {
                    '/shopList': ''
                }
            },
            'shopListTest': {
                target: 'https://h5.biyao.com/classify/getCategoryProductList',
                changeOrigin: true,
                pathRewrite: {
                    'shopListTest': ''
                }
            },
            '/comment': {
                target: 'https://m.biyao.com/products/getCommentList',
                changeOrigin: true,
                pathRewrite: {
                    '/comment': ''
                }
            },
            // https://h5.biyao.com/api/classify/categoryListNew
            'categoryListNew': {
                target: 'https://h5.biyao.com/api/classify/categoryListNew',
                changeOrigin: true,
                pathRewrite: {
                    'categoryListNew': ''
                }
            }
        }
    }
}

